<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{countryGameAction}" />
	
	<span class="pagetitle">游戏内分析 —— 国家分析</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
        <p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd" />
		-
		<p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd" />
		&#160;&#160;&#160;
		
        <p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
	</h:form>
	<br />

	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel2" header="新增角色" style="margin-bottom:10px;">
				<p:dataTable id="dlist" var="l" value="#{bean.countryGameData}" rowIndexVar="rowIndex" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">
					<f:facet name="{Exporters}">
						<h:commandLink styleClass="exporter">
					        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
					        <p:dataExporter type="xls" target="dlist" fileName="countryGameData-#{pageHelper.getNewDateDetailStr()}" />
					    </h:commandLink>
					</f:facet>
					
					<p:column headerText="国家" styleClass="column grcnewUser">
						<h:outputLabel value="#{bean.getCountryNameById(l.countryid)}" />
					</p:column>
                    <p:column headerText="总新增" styleClass="column grcnewUser">
                        <h:outputLabel value="#{l.countryNewRole}" />
                    </p:column>
                    <p:column headerText="国家比例" styleClass="olumn grcnewUser">
                        <h:outputLabel value="#{pageHelper.double2Percent(l.countryNewRole * 1.0 / l.allNewRole)}" />
                    </p:column>
					<c:forEach items="#{l.newRoleSchoolCounts}" var="entry">
						<p:column headerText="#{bean.getSchoolNameById(entry.key)}" styleClass="column grcnewDevice">
							<h:outputText value="#{pageHelper.double2Percent(entry.value * 1.0 / l.countryNewRole)}" />
						</p:column>
					</c:forEach>
                    <p:column headerText="职业占比总计" styleClass="column grcnewUser" rendered="false">
                        <h:outputLabel value="#{l.activeUser}" />
                    </p:column>
				</p:dataTable>
    		</p:panel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>